#include "uniEdges.hpp"
#include "rectMeshFunctions.hpp"
#include "structMeshFunctions.hpp"
#include "uniMesh.hpp"

namespace hms
{

UniEdges::UniEdges( const UniMesh& mesh ) :
	StructEdgesBase<UniEdges>(mesh)
{}

auto UniEdges::lengthsImp() const -> LengthsReturnType {
	const Index
		nh { nHorizontalEdges( this->mesh().size() ) },
		nv { this->mesh().nEdges() - nh };

	
	return concat_vertical(
		ArrayXs::Constant( nh, this->mesh().dx() ),
		ArrayXs::Constant( nv, this->mesh().dy() )
	);
}

auto UniEdges::normalsImp() const -> NormalsReturnType {
	return rectNormals( this->mesh().size(), this->mesh().nEdges() );
}


} // namespace hms
